package com.wei.myhame.presenter.login;

import android.util.Log;

import com.wei.myhame.base.BasePresenter;
import com.wei.myhame.base.interfaces.contract.login.VisitmattersContract;
import com.wei.myhame.component.CommonSubscriber;
import com.wei.myhame.model.bean.VisitmattersBean;
import com.wei.myhame.model.http.HttpManager;
import com.wei.myhame.utils.RxUtils;

import java.util.HashMap;

public class VisitmattersPresenter extends BasePresenter<VisitmattersContract.view> implements VisitmattersContract.presenter{

    @Override
    public void initData(HashMap<String, Object> map,String token) {
        addSubscribe(HttpManager.getLoginServiceApi().getVisitmatters(map,token)
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<VisitmattersBean>(mView) {
                    @Override
                    public void onNext(VisitmattersBean visitmattersBean) {
                        Log.e("返回的数据",""+visitmattersBean.toString());
                        mView.showData(visitmattersBean);

                    }
                }));
    }
}
